package com.lhd._04mybatis;

import com.lhd._04mybatis.mapper.CommentMapper;
import com.lhd._04mybatis.pojo.entity.Comment;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Date;

/**
 * @author lhd
 * @date 2024/4/18
 * @apiNote
 */
@SpringBootTest
public class ApplicationTests2 {

    @Autowired
    CommentMapper commentMapper;
    @Test
    void insertCommentTest()
    {
        Comment comment = new Comment();
        comment.setId(1000L);
        comment.setContent("测试评论");
        comment.setCreated(new Date());
        comment.setUserId(1L);
        comment.setWeiboId(1L);
        System.out.println(commentMapper.insertComment(comment));
    }

    @Test
    void deleteCommentTest()
    {
        System.out.println(commentMapper.deleteComment(1L));
    }

    @Test
    void selectCommentByIdVO1Test(){
        System.out.println(commentMapper.selectCommentVO1ById(1000L));
    }

    @Test
    void selectCommentByIdVO2Test(){
        System.out.println(commentMapper.selectCommentVO2ByWeiboId(200L));
    }


}
